import request from '@/utils/request'
import qs from 'qs'

export function goodsList(data) {
  return request({
    url: 'sh/goods/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function goodsAdd(data) {
  return request({
    url: 'sh/goods/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function goodsStatus(id) {
  return request({
    url: 'sh/goods/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function goodsUploadImage(data) {
  return request({
    url: 'sh/goods/uploadImage',
    method: 'post',
    data: qs.stringify(data)
  })
}

/** ======= 评论 ======= */
export function commentList(data) {
  return request({
    url: 'sh/comment/list',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function commentAdd(data) {
  return request({
    url: 'sh/comment/add',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function commentStatus(id) {
  return request({
    url: 'sh/comment/status',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

export function commentDel(id) {
  return request({
    url: 'sh/comment/del',
    method: 'post',
    data: qs.stringify({ id: id })
  })
}

